#ifndef WXLED_H
#define WXLED_H

#include <wx/wxprec.h>

#ifdef __BORLANDC__
    #pragma hdrstop
#endif

#ifndef WX_PRECOMP
    #include <wx/wx.h>
#endif

#include "wxstatectrl.h"
#include <map>

typedef enum wxLedColor
{
	wxLED_RED = 1,
	wxLED_GREEN = 2,
	wxLED_YELLOW = 4,
	wxLED_BLACK = 8
};

typedef enum wxLedShape
{
	wxLED_ROUND = 256,
	wxLED_RECTANGLE = 512,
	wxLED_SQUARE = 1024,
	wxLED_TRIANGLE = 2048
};

class wxLedState : public wxState
{
	DECLARE_DYNAMIC_CLASS( wxLedState )
public:
	wxLedShape m_shape;
	wxLedColor m_color;
	bool m_on;
	bool m_blink;
	int m_blinkInterval;

	wxLedState(): wxState(-1){}
	wxLedState( wxStateId id, wxLedShape shape, wxLedColor color, bool on = true, bool blink = false, int blinkInterval = 0 );
};

class wxLed : public wxStateCtrl
{
protected:
	wxLedState* m_state;
	wxString GetXPM();
	std::map< int, const char** > m_xpms;

public:
	wxLed( wxWindow* parent, wxWindowID id, wxPoint pos = wxDefaultPosition, wxSize size = wxDefaultSize, int style = wxNO_BORDER );
	bool SetCurrentState( wxStateId id );
	wxState* GetCurrentState();

	wxSize DoGetBestSize() const;
	void OnPaint( wxPaintEvent& event );

	DECLARE_EVENT_TABLE()
};


#endif //WXLED_H
